<template>
	<div class="ShopCar">
		<header>
			<span @click="goBack()">返回</span>
			<h1>购物车</h1>
		</header>
		<ShopCarHave v-if="isShow"></ShopCarHave>
		<ShopCarNone v-else></ShopCarNone>
		<MenuBar></MenuBar>
	</div>
</template>
<script>
	import ShopCarHave from './components/ShopCarHave'
	import ShopCarNone from './components/ShopCarNone'
    export default {
		components:{
			ShopCarHave,
			ShopCarNone
		},
		
		data(){
			return{
				isShow:true
			}
		},
		
		methods:{
			goBack(){
				this.$router.go(-1)
			}
		},
		
		mounted(){
			var proList = JSON.parse(localStorage.getItem("proList"))
			if(proList===null){
				this.isShow = false
			}
		}
	}
</script>
<style lang='stylus' scoped>
	.ShopCar
		height 100%
		header
			height 93px
			display flex
			justify-content center
			position relative
			align-items center
			background #ff9900
			span
				position absolute
				left 40px
			span,h1
				color #fff
</style>
